<script>
import router from '@/router';
import axios from 'axios';

export default{
    data(){
        return{
            workmax:'',
            workmin:'',
            workname:'',
            workschool:'',
            workyear:'',
            address:''
        }
    },
    methods:{
        workupload(){
            var workdata={
                workmax:this.workmax,
                workmin:this.workmin,
                workname:this.workname,
                workschool:this.workschool,
                workyear:this.workyear,
                address:this.address,
            }
            console.log(workdata);
            console.log(111);
            axios.post('http://127.0.0.1:5000/parse',workdata).then(res=>{
                console.log(res.data);
                localStorage.setItem('workdata',JSON.stringify(res.data))
            })
        },
        parse(){
            router.push({name:'Parse'})
        }
    }
}

</script>

<template>
   <div class="col-md-12">
                    <div class="form-style">
                        <form>
                            <div class="row text-center">
                                <div class="col-md-2">
                                    <p>
                                        岗位名称
                                    </p>
                                </div>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" id="email"  v-model="workname">
                                </div>
                                <div class="col-md-1"></div>
                                <div class="col-md-2 text-center">
                                    <p>
                                        工作年限
                                    </p>
                                </div>
                                <div class="col-md-4">
                                  <input type="text" class="form-control" placeholder="最低工作年限" v-model="workyear">
                                </div>
                            </div>
                            
                            <div class="row text-center">
                                <div class="col-md-2 t2">
                                    <p>
                                        最高学历
                                    </p>
                                </div>
                                <div class="col-md-4">
                                  <input type="text" class="form-control"  v-model="workschool">
                                </div>
                                <div class="col-md-1"></div>
                                <div class="col-md-2 text-center">
                                    <p>
                                        工作待遇
                                    </p>
                                </div>
                                <div class="col-md-2">
                                  <input type="text" class="form-control" placeholder="最低工资" v-model="workmin">
                                </div>
                                <div class="col-md-1 text-center">
                                    <hr class="diao">
                                </div>
                                <div class="col-md-2">
                                  <input type="text" class="form-control" placeholder="最高工资" v-model="workmax">
                                </div>
                            </div>

                            <div class="row text-center">
                                <div class="col-md-2">
                                    <p>
                                        工作地点
                                    </p>
                                </div>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" placeholder="精确到城市" v-model="address">
                                </div>
                                    <!-- <div class="col-md-2 select-jianxi">
                                        <select class="form-select form-select-sm form-control-select" id="sel5" name="sellist3">
                                            <option>吉林省</option>
                                            <option>2</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                          </select>
                                    </div>
                                    <div class="col-md-2 select-jianxi">
                                        <select class="form-select form-select-sm form-control-select" id="sel5" name="sellist3">
                                            <option>1</option>
                                            <option>2</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                          </select>
                                    </div>
                                    <div class="col-md-2">
                                        <select class="form-select form-select-sm form-control-select" id="sel5" name="sellist3">
                                            <option>宽城区</option>
                                            <option>2</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                          </select>
                                    </div> -->
                            </div>

                            <div class="row text-center">
                                <div class="col-md-2">
                                    <p>
                                        岗位职责
                                    </p>
                                </div>
                                <div class="col-md-4">
                                    <textarea class="form-control" rows="6" id="comment" name=""></textarea>
                                </div>
                                <div class="col-md-1"></div>
                                <div class="col-md-2 text-center">
                                    <p>
                                        任职要求
                                    </p>
                                </div>
                                <div class="col-md-4">
                                    <textarea class="form-control" rows="6" id="comment" name=""></textarea>
                                </div>
                            </div>

                            <div class="btn-group text-center col-md-8">
                                <button type="button" class="btn btn-primary button-jianxi " @click="workupload">岗位添加</button>
                                <div class="col-md-2"></div>
                                <div class="col-md-2"></div>
                                <button type="button" class="btn btn-primary button-jianxi" @click="parse">岗位匹配</button>
                                <!-- <button type="button" class="btn btn-primary">Sony</button> -->
                              </div>
                        </form>
                    </div>
                </div>

</template>

<style scoped>
.diao{
    color: black;
    width: 45px;
    height: 3px;
}

.form-style{
                background-color: rgba(240, 254, 255, 0.356);
                height: 500px;
                margin-top: 50px;
                border-radius: 10%;
                padding-top: 50px;
            }
            form{
                padding-left:20px ;
                text-align: center;
            }
            .row input{
                height: 30px;
            }
            .row p{
                line-height: 30px;
            }
            .row{
                margin-bottom: 15px;
            }
            .select-jianxi{
                margin-right: 35px;
            }
        
            .form-control-select{
                width: 120%;
            }
            p{
                margin-left: 0px;
                margin-right: 0px;
                font: 10px
            }
            .col-md-2{
                width: 12%;
                padding-right: 0px;
            }
            .col-md-1{
                /* height: 60px; */
                width: 55px;
            }
           
</style>